//
//  global.hpp
//  NLCEQ_mixed
//
//  Created by Duong Ngo on 8/5/16.
//  Copyright © 2016 Duong Ngo. All rights reserved.
//

#ifndef global_hpp
#define global_hpp

#include <stdio.h>
#include <vector>
#include <string>
#include <map>

/* GLOBAL PARAMETERS */

//Bankers
extern const double varphi;      // Reserves Requirement
extern const double beta_b;      // Bankers's discount factor
extern const double Rn;  // Lower bound of interest on reserves
extern const double kappa;         // Capital requirement
extern const double thetaa;     // Cost of collecting loan
extern const double deltab;       // Loan amortization


//Households
extern const double beta_h;      // Household's discount factor
extern const double epsilon;        // Elasticity of substitution
extern const double alphaa;       // Parameters in production function
extern const double deltak ;    // Capital depriciation
extern const double iota;           //Nominal Price Rigidity
extern const double chi;        // Labor disutility
extern const double bh_limit;     // Borrowing limit
extern const double nu;          // Inverse Frisch elasticity


//Government policy
extern const double phipie;    //Policy repsonds to inflation
extern const double phiy;       //Policy respond to output gap

//Shock
extern const double rho; // Persistence of shock
extern const double rho_rf; // Persistence of IR shock


//FOC Problem
extern const int var_foc; //Number of variables in each period
extern const int dim_state; // Number of state variables
extern const int dim_forward; // Number of foward variables
extern const int T; // Number of periods

//Other variables
extern const double s_max;    // Coefficient in soft-max constraint
extern const double Rf_min; // The minimum of FFR > Rn
extern double max_error; //Check the maximum error
extern const double pe;
extern const int T_forward;   // Number of period in forward guidance


// Global vector
extern std::vector<double> result;  // Store result in Ipopt
extern std::vector<int> state_position; // Position of state var
extern std::vector<int> forward_position; // Position of forward var
extern std::map<std::string, int> original_map; // Map the name of variable to its position
extern std::vector<int> var_role; //Vector stores the role of each variable (<dim: state, dim: other)
extern std::vector<double> starting_state; // The state at time 0
extern std::map<std::string, int> eqn_map; //Map the name of equation to its position
extern std::vector<double> vec_kappa; //Exogenous variables
extern std::vector<double> shock_rf; // Exogenous for shock FFR

// Struct
struct variables {
    double  gamma, cb, Rf, Rm, ql, mur, muc, ip, pie, n, m, bh, k, tau, s, ch, etaz, lama, lamb, etab, i , pm, y, l, u;
    double gamma_f, ip_f, ql_f, lamb_f, lama_f, pm_f, pie_f, y_f;
    double n_p, m_p, bh_p, k_p, Rm_p;
};

















#endif /* global_hpp */
